package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BaseCities;
import com.nmf.dao.gen.bean.BaseCitiesExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BaseCitiesMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @SelectProvider(type=BaseCitiesSqlProvider.class, method="countByExample")
    long countByExample(BaseCitiesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @DeleteProvider(type=BaseCitiesSqlProvider.class, method="deleteByExample")
    int deleteByExample(BaseCitiesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @Delete({
        "delete from base_cities",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @Insert({
        "insert into base_cities (id, city_name, ",
        "province_id, province_name, ",
        "create_date, update_date)",
        "values (#{id,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, ",
        "#{provinceId,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP})"
    })
    int insert(BaseCities record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @InsertProvider(type=BaseCitiesSqlProvider.class, method="insertSelective")
    int insertSelective(BaseCities record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @SelectProvider(type=BaseCitiesSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<BaseCities> selectByExample(BaseCitiesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @Select({
        "select",
        "id, city_name, province_id, province_name, create_date, update_date",
        "from base_cities",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    BaseCities selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @UpdateProvider(type=BaseCitiesSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BaseCities record, @Param("example") BaseCitiesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @UpdateProvider(type=BaseCitiesSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BaseCities record, @Param("example") BaseCitiesExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @UpdateProvider(type=BaseCitiesSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BaseCities record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_cities
     */
    @Update({
        "update base_cities",
        "set city_name = #{cityName,jdbcType=VARCHAR},",
          "province_id = #{provinceId,jdbcType=VARCHAR},",
          "province_name = #{provinceName,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BaseCities record);
}